package com.example.ercmssystem2.service;

import com.example.ercmssystem2.entity.User;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public interface UserService extends UserDetailsService {
    
    User findByUsername(String username);
    
    boolean existsByUsername(String username);
    
    User getCurrentUser();
    
    boolean isSystemAdmin(User user);
    
    boolean isDeptAdmin(User user);
    
    boolean isDispatcher(User user);
    
    boolean isEndUser(User user);
    
    List<User> getUsersByDepartment(Long departmentId);
    
    List<User> getDepartmentManagers();
    
    User updateUserDepartment(Long userId, Long departmentId);
    
    List<User> getAvailableManagers();
    
    List<User> getAvailableUsers();
    
    void updateUserStatus(Long userId, String status);
    
    boolean isUserAvailable(Long userId);
    
    // Additional methods for UserController
    List<User> findAllUsers();
    
    User findById(Long id);
    
    List<User> findByDepartmentId(Long departmentId);
    
    List<User> findByRole(String role);
    
    List<User> findByDepartmentIds(List<Long> departmentIds);
    
    User saveUser(User user);
    
    void deleteUser(Long id);
    
    // ========== 统计分析相关方法 ==========
    
    /**
     * 获取人员绩效统计
     */
    Map<String, Object> getPersonnelPerformanceStatistics(LocalDateTime start, LocalDateTime end);
} 